package com.linko.intelligent.remote.pojo.vo;


import com.baomidou.mybatisplus.annotation.TableField;
import com.linko.intelligent.remote.pojo.po.Category;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

@Data
public class CategoryVo extends Category {
    /**
     * 子节点（包括子类别和设备信息）
     */
    @TableField(exist = false)
    private List<Object> children;

    public void addChild(Object child) {
        if (children == null) {
            children = new ArrayList<>();
        }
        children.add(child);
    }

    public void setChildren(List<Object> children) {
        this.children = children;
    }
}

